<script setup>
import { useTemplateRef, onMounted,watch  } from 'vue'
import calc from './component/calc.vue'
defineProps(['num'])
const emit= defineEmits(['num-change'])
const childRef = useTemplateRef('calc')
const chindrenC =(v)=>{
    console.log(v,'子组件');

    emit('num-change',v)
}

onMounted(() => {
    console.log(childRef);
    
})
</script>

<template>
  <calc ref="calc" :num="num"  @numChange="chindrenC"/>
</template>